package com.pox.guli.service.edu.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pox.guli.service.base.dto.CourseDto;
import com.pox.guli.service.edu.entity.Course;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pox.guli.service.edu.entity.vo.CoursePublishVo;
import com.pox.guli.service.edu.entity.vo.CourseVo;
import com.pox.guli.service.edu.entity.vo.WebCourseVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 课程 Mapper 接口
 * </p>
 *
 * @author pox21s
 * @since 2022-06-01
 */
public interface CourseMapper extends BaseMapper<Course> {

    /**
     * 多表查询，返回课程列表返回信息
     * @param pageParam 分页
     * @param queryWrapper 查询条件
     * @return java.util.List<com.pox.guli.service.edu.entity.vo.CourseVo>
     */
    List<CourseVo> selectPageByCourseQueryVo(Page<CourseVo> pageParam,
                                             @Param(Constants.WRAPPER)
                                             QueryWrapper<CourseVo> queryWrapper);

    CoursePublishVo selectCoursePublishVoById(String id);

    /**
     * 多表联查，返回课程信息和讲师信息
     * @param courseId 课程id
     * @return com.pox.guli.service.edu.entity.vo.WebCourseVo
     */
    WebCourseVo selectWebCourseVoById(String courseId);

    /**
     * 根据订单多表联查课程信息
     * @param courseId 课程id
     * @return com.pox.guli.service.base.dto.CourseDto
     */
    CourseDto selectCourseDtoById(String courseId);
}
